import { createChunk } from "../creatChunk";

onmessage = async (e) => {
    const {
        fileitem,
        file,
        chunkSize,
        StartchunkIndex: start,
        EndchunkIndex: end,
    } = e.data;
    // const Promises = [];
    for (let i = start; i < end; i++) {
        const chunk = await createChunk(fileitem, i, chunkSize);
        // Promises.push(chunk);
        postMessage(chunk);
    }
    // const chunks = await Promise.all(Promises);
};  